import service from "../utils/request";
//注册
export function user_register(payload = {}) {
  return service.post("/api/user/dofinishregister", payload)
}
//发短信验证码

export function user_dosendmsgcode(payload = {}) {
  return service.post("/api/user/dosendmsgcode", payload)
}
//验证手机号码是否被注册过

export function user_docheckphone(payload = {}) {
  return service.post("/api/user/docheckphone", payload)
}
//登录
export function user_login(payload = {}) {
  return service.post("/api/user/login", payload)
}

//请求轮播图


export function banner_list(payload = {}) {
  return service.get("/api/banner/list", {
    params: payload
  })
}

export function navlist(payload = {}) {
  return service.get("/api/index/catelist", {
    params: payload
  });
}
//请求秒杀
export function seckilllist_list(payload = {}) {
  return service.get("/api/pro/seckilllist", {
    params: payload
  })
}
// 获取推荐产品列表
export function recommendlist_list(payload = {}) {
  return service.get("/api/pro/recommendlist", {
    params: payload
  })
}
//获取分类列表

export function categorylist_list(payload = {}) {
  return service.get("/api/pro/categorylist", {
    params: payload
  })
}

// 获取分了品牌的数据

export function categorybrandlist_list(payload = {}) {
  return service.get("/api/pro/categorybrandlist", {
    params: payload
  })
}
// 获取品牌下的具体商品
export function categorybrandprolist_list(payload = {}) {
  return service.get("/api/pro/categorybrandprolist", {
    params: payload
  })
}
//发请求去拿商品的详情数据 需要商品id

export function detail_list(id) {
  return service.get("/api/pro/detail/" + id)
}


//根据查找搜素

export function search_list(payload = {}) {
  return service.get("/api/pro/search", {
    params: payload
  })
}
//热门搜索
export function hotword_list(payload = {}) {
  return service.get("/api/pro/hotword", {
    params: payload
  })
}

//j加入购物车

export function cart_add(payload = {}) {
  return service.post("/api/cart/add", payload)
}

// 获取购物车列表

export function cart_list(payload = {}) {
  return service.post("/api/cart/list", payload)
}
//购物车减减

export function remove_list(payload = {}) {
  return service.post("/api/cart/remove", payload)
}
//更新购物车数量


export function updatenum_list(payload = {}) {
  return service.post("/api/cart/updatenum", payload)
}

//更新当前购物车状态

export function cart_selectone(payload = {}) {
  return service.post("/api/cart/selectone", payload)
}
// 支付时删除购物车
export function hotword_deleteCartItem(payload = {}) {
  return service.get("/api/order/deleteCartItem", {
    params: payload
  })
}
//获取城市列表

export function sortCity_json(payload = {}) {
  return service.get("/city/sortCity.json", {
    params: payload
  })
}
// 更改用户名
export function user_bindusername(payload = {}) {
  return service.get("/api/user/bindusername", {
    params: payload
  })
}

//修改密码
export function user_updatePassword(payload = {}) {
  return service.get("api/user/updatePassword", {
    params: payload
  })
}
//获取用户信息

export function user_info(payload = {}) {
  return service.get("/api/user/info", {
    params: payload
  })
}
//添加地址

export function address_add(payload = {}) {
  return service.post("/api/address/add", payload)
}
//获取地址列表

export function address_list(payload = {}) {
  return service.get("/api/address/list", {
    params: payload
  })
}
//删除地址

export function address_delete(payload = {}) {
  return service.post("/api/address/delete", payload)
}

//更新编辑地址
export function address_update(payload = {}) {
  return service.post("/api/address/update", payload)
}
//添加订单

export function order_addOrder(payload = {}) {
  return service.post("/api/order/addOrder", payload)
}
//查看全部订单

export function user_orderlist(payload = {}) {
  return service.get("/api/user/orderlist", {
    params: payload
  })
}

//修改订单地址
export function order_updateOrderAddress(payload = {}) {
  return service.post("/api/order/updateOrderAddress", payload)
}
//获取确认订单的信息
export function order_confirmOrder(payload = {}) {
  return service.get("/api/order/confirmOrder", {
    params: payload
  })
}